import { Sequelize } from "sequelize";

export const sequelize = new Sequelize({
    dialect:"sqlite",
    storage:"./db.db"
})

export const sync = async () =>{
    let {Blog} = await import("../model/Blog.js")
    await sequelize.sync({force:true})
    let arr = [
        {
            title:"红红火火",
            author:"123"
        },
        {
            title:"高高兴兴",
            author:"456"

        },
        {
            title:"开开心心",
            author:"789"
        },
        {
            title:"快快乐乐",
            author:"147"

        }
    ]
    Blog.bulkCreate(arr)
}